import React from "react";
import {filterCodes} from "../BaseFilter";
import ComponentType from "../../Config/ComponentType";
import InputFilter from "../../InputComp/InputFilter";
import NumberFilter from "../../NumberInput/NumberFilter";
import DateFilter from "../../DateComp/DateFilter";
import SwitchFilter from "../../SwitchComp/SwitchFilter";
import ComboBoxFilter from "../../ComboBox/ComboBoxFilter";
import ObjectBoxFilter from "../../ObjectBox/ObjectBoxFilter";
import EmbedSelectorFilter from "../../EmbedSelector/EmbedSelectorFilter";
// import CustEmbedSelectorFilter from "../../CustEmbedSelector/CustEmbedSelectorFilter";
// import TagFinderFilter from "../../TagFinder/TagFinderFilter";
// import TagEditorFilter from "../../TagEditor/TagEditorFilter";
// import ArrangeCombinationsFilter from "../../ArrangeCombinations/ArrangeCombinationsFilter";

export const getFilterByType = (type, props = {}) => {

    switch (type) {
        case ComponentType.TEXT_INPUT:
            return <InputFilter {...props} />;
        case ComponentType.TEXT_AREA:
            return <InputFilter textarea={true}  {...props} />;
        case ComponentType.NUMBER_INPUT:
            return <NumberFilter {...props} />;
        case ComponentType.CALENDAR:
            return <DateFilter {...props} />;
        case ComponentType.CHECK_BOX:
            return <SwitchFilter {...props} />;
        case ComponentType.COMBO_BOX:
            return <ComboBoxFilter {...props} />;
        case ComponentType.FINDER:
            return <ObjectBoxFilter {...props} />;
        // case ComponentType.TAG_FINDER:
        //     return <TagFinderFilter {...props} />;
        // case ComponentType.TAG_EDITOR:
        //     return <TagEditorFilter {...props} defaultFilterCode={filterCodes.fuzzy.code}/>;
        case ComponentType.EMBED_SELECTOR:
            return <EmbedSelectorFilter {...props} />;
        // case ComponentType.CUST_EMBED_SELECTOR:
        //     return <CustEmbedSelectorFilter {...props} />;
        // case ComponentType.ARRANGE_COMBINATIONS:
        //     return <ArrangeCombinationsFilter {...props} />;
        default:
            return <InputFilter {...props} />;
    }

};